package com.itheima.myreflect2.Student.convertedio;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @program: Myset
 * @description:对象操作输出流
 * @author: xuejingjing
 * @create: 2021-06-16 10:22
 **/

public class ConvertedDemo3 {
    public static void main(String[] args) throws IOException {
         User user = new User("zhangsan","qwer");
         //创建一个字节流
        ObjectOutputStream ops = new ObjectOutputStream(new FileOutputStream("d.txt"));
        ops.writeObject(user);
        ops.close();

    }
}
